#!/usr/bin/python
# -*- coding: utf-8 -*-

import psycopg2
import sys


con = None

try:
     
    con = psycopg2.connect(database='mydb', user='jlin', password='passw0rd') 
    cur = con.cursor()
    cur.execute('SELECT description from experiment')          
    rows = cur.fetchall()
    for row in rows:
        print row
    #print "\n".join(rows)
    #print ver    
    

except psycopg2.DatabaseError, e:
    print 'Error %s' % e    
    sys.exit(1)
    
    
finally:
    
    if con:
        con.close()
